Micron Document
🎖️GitЯра🎖️

Commit 9019c4e2eb9663bd8f90c91e74eb4494d9104005


Parents : 4797adc
Author : James Rich <james.a.rich@gmail.com>
Date : 2026-05-21T16:07:47-05:00

feat(ui): add faint node color tint to card background

Blend 5% of the node's identity color into the card container color
using lerp(). Transparent nodeColor (nodes with no assigned color)
keeps the default M3 surfaceContainerLow background unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Changes
Diff

diff --git a/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.kt b/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.kt
index 32994f77e2..e6a564280a 100644
--- a/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.kt
+++ b/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.kt
@@ -42,6 +42,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
@@ -81,7 +82,7 @@ private const val INACTIVE_BORDER_ALPHA = 0.2f
private const val GRID_COLUMNS = 3
@Composable
-@Suppress("LongMethod")
+@Suppress("LongMethod", "CyclomaticComplexMethod")
fun NodeItem(
thisNode: Node?,
thatNode: Node,
@@ -111,7 +112,12 @@ fun NodeItem(
val bearingDegrees = remember(thisNode, thatNode) { thisNode?.bearing(thatNode) }
val contentColor = MaterialTheme.colorScheme.onSurface
- val cardColors = CardDefaults.cardColors()
+ val nodeColor =
+ (if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let { Color(it) } ?: Color.Transparent
+ val cardContainerColor = CardDefaults.cardColors().containerColor
+ val tintedContainerColor =
+ if (nodeColor == Color.Transparent) cardContainerColor else lerp(cardContainerColor, nodeColor, 0.05f)
+ val cardColors = CardDefaults.cardColors(containerColor = tintedContainerColor)
val borderColor =
(if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let {
Color(it).copy(alpha = if (isActive) ACTIVE_BORDER_ALPHA else INACTIVE_BORDER_ALPHA)
@@ -152,9 +158,6 @@ fun NodeItem(
)
}
- val nodeColor =
- (if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let { Color(it) } ?: Color.Transparent
-
Card(
modifier =
modifier.nodeCardGlow(lastHeard = thatNode.lastHeard, nodeColor = nodeColor).fillMaxWidth().semantics(

diff --git a/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItemCompact.kt b/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItemCompact.kt
index d67a46e229..8a1c8af26c 100644
--- a/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItemCompact.kt
+++ b/core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItemCompact.kt
@@ -37,6 +37,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.semantics.Role
@@ -135,7 +136,12 @@ fun NodeItemCompact(
}
val contentColor = MaterialTheme.colorScheme.onSurface
- val cardColors = CardDefaults.cardColors()
+ val nodeColor =
+ (if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let { Color(it) } ?: Color.Transparent
+ val cardContainerColor = CardDefaults.cardColors().containerColor
+ val tintedContainerColor =
+ if (nodeColor == Color.Transparent) cardContainerColor else lerp(cardContainerColor, nodeColor, 0.05f)
+ val cardColors = CardDefaults.cardColors(containerColor = tintedContainerColor)
val borderColor =
(if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let {
Color(it).copy(alpha = if (isActive) ACTIVE_BORDER_ALPHA else INACTIVE_BORDER_ALPHA)
@@ -164,9 +170,6 @@ fun NodeItemCompact(
)
}
- val nodeColor =
- (if (isThisNode) thisNode?.colors?.second else thatNode.colors.second)?.let { Color(it) } ?: Color.Transparent
-
Card(
modifier =
modifier.nodeCardGlow(lastHeard = thatNode.lastHeard, nodeColor = nodeColor).fillMaxWidth().semantics(

Served by rngit 1.5.0 - Generated in 0.06s